<template>
  <div>
    <x-header id="header"  :left-options="{backText: ''}">{{title}}</x-header>
    <div class="main-header">
      <div class="article-con">
        <div class="article-title">{{title}}</div>
        <div class="article-time" >{{time}}</div>
        <div v-html="content"></div>
      </div>
    </div>
  </div>
</template>

<script>
  import { getArticleDetail } from '@/api/article'
  import { interval } from "@/libs/util";

  export default {
    name: 'article-detail',
    data () {
      return {
        title: '',
        content: '',
        time: ''
      }
    },
    mounted () {
      getArticleDetail(this.$route.query.id).then(data => {
        this.title = data.title
        this.content = data.content
        this.time = interval(data.createTime)
      })
    }
  }
</script>

<style scoped>

</style>
